package com.ellison.springdemo.springbase.mvc.controller;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>通过继承 AbstractController 也可做 controller
 *
 * @author Ellison_Pei
 * @date 2022/3/9 19:29
 * @since 1.0
 **/
@Component("/beanName/index")
public class BeanNameController extends AbstractController {
    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        System.out.println("=======/beanName/index");
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("Ok");
        return modelAndView;
    }
}
